<%@ taglib prefix="s" uri="/struts-tags"%> 
<s:set var="context_path" value="#request.get('javax.servlet.forward.context_path')"></s:set>
<link rel="stylesheet" href="${context_path}/jquery-treeview/jquery.treeview.css"/>
<s:if test="productTypes == null || productTypes.size() == 0">
 <span style="color: red"> No Product Type Added, TreeView Empty! </span>
</s:if>
<s:else>
  <ul id="black" class="treeview-black">
    <s:iterator value="productTypes">
      <li>
        <s:if test="children == null || children.isEmpty()">
          <span>
            <s:a action="productAction_queryProductsByProductType" namespace="/product">
              <s:param name="product.productType.typeId" value="typeId"/>
              <s:param name="product.productType.name" value="name"/>
              <s:property value="name"/>
            </s:a>
          </span>  
        </s:if>
        <s:else>
          <span><s:property value="name"/></span>
          <ul>
            <s:iterator value="children">
              <li>
                <s:if test="children == null || children.isEmpty()">
                  <span>
                    <s:a action="productAction_queryProductsByProductType" namespace="/product">
                      <s:param name="product.productType.typeId" value="typeId"/>
                      <s:param name="product.productType.name" value="name"/>
                      <s:property value="name"/>
                    </s:a>
                  </span>
                </s:if>
                <s:else>
                  <span><s:property value="name"/></span>
                  <ul>
                    <s:iterator value="children">
                      <li>
                        <s:if test="children == null || children.isEmpty()">
                          <span>
                            <s:a action="productAction_queryProductsByProductType" namespace="/product">
                              <s:param name="product.productType.typeId" value="typeId"/>
                              <s:param name="product.productType.name" value="name"/>
                              <s:property value="name"/>
                            </s:a>
                          </span>
                        </s:if>
                        <s:else>
                          <span><s:property value="name"/></span>
                          <ul>
                            <s:iterator value="children">
                              <li>
                                <s:if test="children == null || children.isEmpty()">
                                  <s:a action="productAction_queryProductsByProductType" namespace="/product">
                                    <s:param name="product.productType.typeId" value="typeId"/>
                                    <s:param name="product.productType.name" value="name"/>
                                    <s:property value="name"/>
                                  </s:a>
                                </s:if>
                                <s:else>
                                  <span><s:property value="name"/></span>
                                  <ul>
                                    <s:iterator value="children">
                                      <li>
                                        <s:a action="productAction_queryProductsByProductType" namespace="/product">
                                          <s:param name="product.productType.typeId" value="typeId"/>
                                          <s:param name="product.productType.name" value="name"/>
                                          <s:property value="name"/>   
                                        </s:a>
                                      </li>
                                    </s:iterator> 
                                  </ul>
                                </s:else>  
                              </li>
                            </s:iterator>
                          </ul>
                        </s:else>
                      </li>
                    </s:iterator>
                  </ul>
                </s:else>
              </li>
            </s:iterator>
          </ul>
        </s:else>
      </li>
    </s:iterator>  
  </ul> 
</s:else>
<script type="text/javascript" src="${context_path}/jquery-treeview/jquery.min.js"></script>
<script type="text/javascript" src="${context_path}/jquery-treeview/jquery.treeview.js"></script>
<script type="text/javascript" src="${context_path}/jquery-treeview/study/jquery.cookie.js"></script>
<script type="text/javascript" src="${context_path}/jquery-treeview/study/main.js"></script>            
            